package cn.wangsy.zhidao.p20170407;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.ImageObserver;

public class Person extends BaseImage {
	int x, y;
	private Image person;

	Person() {
		person = loadImage("images/person.png");
	}

	Person(int x, int y) {
		this.x = x;
		this.y = y;
		person = loadImage("images/person.png");
	}

	public void draw(Graphics g, ImageObserver io) {
		g.drawImage(person, x * 32, y * 32, 32, 32, io);

	}

	public void move(int a) {
		if (a == 1) {
			this.x--;
		} else if (a == 2) {
			this.x++;
		} else if (a == 3) {
			this.y--;
		} else if (a == 4) {
			this.y++;
		}
	}
}
